function ConfirmAdminDelete(dir,FileName){
	var agree=confirm("Are you sure you want to delete this file?");
	if (agree)
	location.replace('index.cfm?c=adminfilemanager&a=deletefile&FileName='+FileName+'&dir='+dir); 
	else
	return false ;
}

function ConfirmAdminDeleteFolder(dir,FolderName){
	var agree=confirm("Are you sure you want to delete '" + FolderName + "' and everything in it!?");
	if (agree)
	location.replace('index.cfm?c=adminfilemanager&a=deletefolder&showfolders=1&FolderName='+FolderName+'&dir='+dir); 
	else
	return false ;
}

function copyadminfile() {
	resetbox(); 
	$('#dialog').load('dialogs/adminfilemanager/copyfile.cfm').dialog({modal: true,my: 'center',at: 'center',of: window,width: 400,height: 300,title:'Drop Shadow'});		
}

function resetbox() {
	document.getElementById('dialog').innerHTML = document.getElementById('defaultdialog').innerHTML;
}

function HideNewFolderForm() {
	document.getElementById('NewFolder').style.display = "None";
}

function ShowNewFolderForm() {
	document.getElementById('NewFolder').style.display = "block";
	document.NewFolderForm.FolderName.focus();
}

function ShowRenameForm(FName) {
	RenameSpanName = 'rename_' + FName;
	NoRenameSpanName = 'norename_' + FName;
	RenameFormName = 'renameform_' + FName;

	Rename_Span = document.getElementById(RenameSpanName);
	NoRename_Span = document.getElementById(NoRenameSpanName);
			
	Rename_Span.style.display = "block";
	NoRename_Span.style.display = "None";
	document.forms[RenameFormName].PageName.focus();
	document.forms[RenameFormName].PageName.select();
	document.getElementById('the_action').value = 'RenameFile';	
}

function HideRenameForm(FName) {
	RenameSpanName = 'rename_' + FName;
	NoRenameSpanName = 'norename_' + FName;
	RenameFormName = 'renameform_' + FName;
		
	Rename_Span = document.getElementById(RenameSpanName);
	NoRename_Span = document.getElementById(NoRenameSpanName);
	document.getElementById('the_action').value = 'RemoveFiles';	
			
	Rename_Span.style.display = "None";
	NoRename_Span.style.display = "Block";
}

function ShowNewPageForm() {
	NewFolder.style.display = "None";
	UploadFile.style.display = "None";
	NewPage.style.display = "block";
	document.NewPageForm.PageName.focus();
}

function ShowUploadForm() {
	NewFolder.style.display = "None";
	NewPage.style.display = "None";
	UploadFile.style.display = "block";
	document.UploadForm.filefield.focus();
}
